<!-- 方案一：粒子背景 + 浮动动画 -->
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>登录 - 粒子特效版</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body {
            height: 100vh;
            background: #0a0a2e;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }

        #particles-js {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .login-box {
            position: relative;
            width: 400px;
            background: rgba(255, 255, 255, 0.1);
            padding: 40px;
            border-radius: 20px;
            backdrop-filter: blur(10px);
            box-shadow: 0 15px 35px rgba(0,0,0,0.2);
            transform: translateY(0);
            transition: all 0.3s;
        }

        .login-box:hover {
            transform: translateY(-5px);
        }

        .input-group {
            margin: 30px 0;
            position: relative;
        }

        input {
            width: 100%;
            padding: 15px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 16px;
            transition: all 0.3s;
        }

        input:focus {
            outline: none;
            background: rgba(255,255,255,0.2);
        }

        label {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(255,255,255,0.6);
            pointer-events: none;
            transition: all 0.3s;
        }

        input:focus ~ label,
        input:valid ~ label {
            top: -10px;
            left: 5px;
            font-size: 12px;
            color: #7f5af0;
        }

        button {
            width: 100%;
            padding: 15px;
            background: linear-gradient(45deg, #7f5af0, #2cb67d);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
        }

        button:hover {
            transform: scale(1.05);
            box-shadow: 0 5px 15px rgba(127,90,240,0.4);
        }
    </style>
</head>
<body>
    <div id="particles-js"></div>
    
    <div class="login-box">
        <h2 style="color: white; text-align: center; margin-bottom: 30px;">欢迎登录</h2>
        <div class="input-group">
            <input type="text" required>
            <label>用户名</label>
        </div>
        <div class="input-group">
            <input type="password" required>
            <label>密码</label>
        </div>
        <button>立即登录</button>
    </div>

    <script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
    <script>
        particlesJS('particles-js', {
            particles: {
                number: { value: 80 },
                color: { value: '#7f5af0' },
                shape: { type: 'circle' },
                opacity: { value: 0.5 },
                size: { value: 3 },
                move: {
                    enable: true,
                    speed: 2,
                    direction: 'none',
                    random: false,
                    straight: false,
                    out_mode: 'out',
                    bounce: false,
                }
            },
            interactivity: {
                detect_on: 'canvas',
                events: {
                    onhover: { enable: true, mode: 'repulse' },
                    onclick: { enable: true, mode: 'push' },
                    resize: true
                }
            }
        });
    </script>
</body>
</html>